import Foundation
import UIKit

public class ViewController1:  UIViewController {
    public override func viewDidLoad() {
        super.viewDidLoad()
        let btn = UIButton(type: .custom)
        btn.frame = CGRect(x: 0, y: 0, width: 200, height: 200)
        btn.setTitle("点击跳转", for: .normal)
        btn.setTitleColor(.green, for:  .normal)
        btn.backgroundColor = .blue
        btn.addTarget(self, action: #selector(onBtnClick), for: .touchUpInside )
        view.addSubview(btn)
    }
    
    @objc func onBtnClick() {
        navigationController?.pushViewController(ViewController2(), animated: true)
    }
}
